package com.veo.dao;


import com.veo.domain.SysLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

public interface SysLogDao {

    @Insert("insert into sysLog(id,visitTime,username,ip,url,executionTime,method) values(#{id},#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    int saveLog(SysLog log);

    //@Select("select * from sysLog")
    @Select("<script>" + "select * from sysLog "+"<where>"+
            "<if test=\"searcherName!= null and searcherName!=''\"> username like concat(#{searcherName},'%')</if>"+
            "</where>"+
            "</script>")
    List<SysLog> finaAllSysLog(@Param("searcherName") String searcherName);

    //删除日志
    @Delete("delete from sysLog where id=#{id}")
    int deleteSysLogById(String id);
}
